Last Update: 2025/3/26
Gizmo OpenAI Uploaded API
The Gizmo OpenAI Uploaded API allows you to upload a file to a specific conversation.
Endpoint
POST https://platform.llmprovider.ai/v1/uploaded
Request Headers
Header | Value |
---|---|
Authorization | Bearer YOUR_API_KEY |
Content-Type | application/json |
Request Body
The request body should be a FormData object with the following parameters:
Parameter | Type | Description |
---|---|---|
conversation_id | string | The ID of the conversation. |
upload_type | string | The type of the upload. my_files or multimodal |
files | multipart.FileHeader | The file to be uploaded(file maxsize <= 20M). multimodal: "image/webp", "image/jpeg", "image/gif", "image/png" my_files: "application/vnd.openxmlformats-officedocument.presentationml.presentation", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/json", "text/x-tex", "application/x-latext", "text/plain", "application/pdf", "text/x-java", "text/markdown", "text/x-script.python", "text/x-ruby", "application/msword", "text/javascript", "text/x-php", "text/x-typescript", "text/x-sh", "text/x-c++", "text/x-csharp", "text/x-c", "text/html" |
model | string | The model to be used.(gizmo-gpt-4o ) |
Request Example
POST /api/gizmo/upload HTTP/1.1
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="conversation_id"
12345
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="upload_type"
image
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="files"; filename="example.png"
Content-Type: image/png
<file content>
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="model"
gizmo-gpt-4o
------WebKitFormBoundary7MA4YWxkTrZu0gW--
Response Body
The response body will be a JSON object containing the generated completions and other metadata.
Field | Type | Description |
---|---|---|
id | string | Unique identifier for the uploaded file. |
name | string | Name of the uploaded file. |
size | int64 | Size of the uploaded file in bytes. |
download_url | string | URL to download the file (optional). |
image_width | int | Width of the image (optional). |
image_height | int | Height of the image (optional). |
use_case | string | Use case of the file (optional). |
fileTokenSize | int | Token size of the file (optional). |
mimeType | string | MIME type of the file. |
conversation_id | string | ID of the conversation (optional). |
Response Example
{
"id": "12345",
"name": "example.png",
"size": 12345,
"download_url": "https://platform.llmprovider.ai/v1/download/12345",
"image_width": 800,
"image_height": 600,
"use_case": "my_files",
"fileTokenSize": 100,
"mimeType": "image/png",
"conversation_id": "12345"
}
Example Request
- Shell
- nodejs
- python
curl -X POST https://platform.llmprovider.ai/v1/uploaded \
-H "Authorization: Bearer $YOUR_API_KEY" \
-H "Content-Type: multipart/form-data" \
-F "upload_type=my_files" \
-F "files=@/root/ceshi.txt" \
-F "model=gizmo-gpt-4o"
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
const apiKey = 'YOUR_API_KEY';
const url = 'https://platform.llmprovider.ai/v1/uploaded';
const formData = new FormData();
formData.append('upload_type', 'my_files');
formData.append('files', fs.createReadStream('/root/ceshi.txt'));
formData.append('model', 'gizmo-gpt-4o');
const headers = {
'Authorization': `Bearer ${apiKey}`,
...formData.getHeaders(),
};
axios.post(url, formData, { headers })
.then(response => {
console.log('Response:', response.data);
})
.catch(error => {
console.error('Error:', error);
});
import requests
import json
api_key = 'YOUR_API_KEY'
url = 'https://platform.llmprovider.ai/v1/uploaded'
headers = {
'Authorization': f'Bearer {api_key}'
}
files = {
"files": open("/root/ceshi.txt", "rb")
}
data = {
"upload_type": "my_files",
"model": "gizmo-gpt-4o"
}
response = requests.post(url, headers=headers, files=files, data=data)
if response.status_code == 200:
print('Response:', response.json())
else:
print('Error:', response.status_code, response.text)
For any questions or further assistance, please contact us at [email protected].